package com.kfdx.dc.system.domain;


import com.baomidou.mybatisplus.annotation.*;

import com.kfdx.dc.common.annotation.Excel;
import com.kfdx.dc.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 文件信息对象 sys_file
 *
 * @author ruoyi
 * @date 2022-04-15
 */
@TableName("sys_file")
@Data
@Accessors(chain = true)
public class SysFileEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 文件ID
     */
    @TableId(value = "file_id", type = IdType.AUTO)
    private Long fileId;

    /**
     * 表ID
     */
    @Excel(name = "表ID")
    @TableField("table_id")
    private String tableId;

    /**
     * 记录ID
     */
    @Excel(name = "记录ID")
    @TableField("record_id")
    private String recordId;

    /**
     * 所属附件组
     */
    @Excel(name = "所属附件组")
    @TableField("attachment_group")
    private String attachmentGroup;

    /**
     * 附件所在路径
     */
    @Excel(name = "附件所在路径")
    @TableField("attachement_path")
    private String attachementPath;

    @Excel(name = "文件大小")
    @TableField("file_size")
    private Long fileSize;


    /**
     * 附件存储类型
     */
    @Excel(name = "附件存储类型")
    @TableField("save_type")
    private String saveType;

    /**
     * 附件格式类型
     */
    @Excel(name = "附件格式类型")
    @TableField("attachement_type")
    private String attachementType;

    /**
     * 附件名称
     */
    @Excel(name = "附件名称")
    @TableField("attachement_name")
    private String attachementName;


    @Excel(name = "可访问URL地址")
    @TableField(exist = false)
    private String visitUrl;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableField("del_flag")
    @TableLogic
    private String delFlag;


    @TableField(exist = false)
    Long[] fileIds;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("fileId", getFileId()).append("tableId", getTableId()).append("recordId", getRecordId()).append("attachmentGroup", getAttachmentGroup()).append("attachementPath", getAttachementPath()).append("saveType", getSaveType()).append("attachementType", getAttachementType()).append("attachementName", getAttachementName()).append("delFlag", getDelFlag()).append("createBy", getCreateBy()).append("createTime", getCreateTime()).append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).append("remark", getRemark()).toString();
    }
}
